﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Common;
using System.Web;
namespace System.Web.Mvc
{
    /// <summary>
    /// 获取服务器地址处理
    /// </summary>
    public class Url_Helper
    {

        /// <summary>
        /// 判断当前请求是否是localhost
        /// </summary>
        /// <returns></returns>
        public static bool IsLocal()
        {
            if (HttpContext.Current.Request.Url.Host.Contains("localhost"))
                return true;
            return false;
        }
        public static string GetDomian_Server()
        {
            if (IsLocal())
            {
                return "http://localhost:62087";
            }
            else
            {
                return "http://www.s.com";
            }
        }
        public static string GetDomian_Session1()
        {
            if (IsLocal())
            {
                return "http://localhost:49935";
            }
            else
            {
                return "http://www.a.com";
            }
        }
        public static string GetDomian_Session2()
        {
            if (IsLocal())
            {
                return "http://localhost:53571";
            }
            else
            {
                return "http://www.d.com";
            }
        }

    }
}
